function [dataset, x, y] = generate_dataset()

s1 = [0, 2];
s2 = [-sqrt(2), -sqrt(2)];
s3 = [sqrt(2), -sqrt(2)];

t1 = 2 * log(0.05);
t2 = 2 * log(0.2);
t3 = 2 * log(0.075);

[x1mat, x2mat] = meshgrid([-2 : 0.1 : 2], [-2 : 0.1 : 2]);

% zamiana macierzy danych testowych na wektory
[na, nb] = size(x1mat);
x1 = reshape(x1mat, 1, na * nb);
x2 = reshape(x2mat, 1, na * nb);

y = zeros(1, na*nb);

for i = 1:na*nb
    d1 = sqrt((s1(1) - x1(i))^2 + (s1(2) - x2(i))^2);
    d2 = sqrt((s2(1) - x1(i))^2 + (s2(2) - x2(i))^2);
    d3 = sqrt((s3(1) - x1(i))^2 + (s3(2) - x2(i))^2);
    
    ymat = [d1^2 - t1, d2^2 - t2, d3^2 - t3];
    [val, y(i)] = min(ymat); 
end; 

x = [x1' x2'];
dataset = [x y'];